/*
 *http://www.apache.org/licenses/LICENSE-2.0
 *Copyright (c) 2021 fullset
 *@ClassName SysOrgController
 *@date 2021/6/29 15:50
 *@author: pangps
 *@Description 组织机构
 */
package com.fs.base.controller;

import com.fs.base.service.SysOrgService;
import com.fs.core.web.BaseResult;
import com.fs.orm.entity.SysOrg;
import com.fs.orm.layui.LayTree;
import com.fs.orm.layui.TableTree;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags="组织机构服务接口")
@RestController
@RequestMapping("/baseService/org")
public class SysOrgController {

    @Autowired
    private SysOrgService sysOrgService;

    @ApiOperation(value = "组织机构树", notes = "树结构展示")
    @PostMapping(value ="/layTree")
    public BaseResult<List<LayTree>> getLayTree() {
        return new BaseResult<>(sysOrgService.getLayTree());
    }

    @ApiOperation(value = "组织机构表格树", notes = "表格树展示")
    @PostMapping(value ="/tableTree")
    public BaseResult<List<TableTree>> getTableTree() {
        return new BaseResult<>(sysOrgService.getTableTree(null));
    }
}
